﻿@using ViewRes

@section Title{
    @Shared.ChangeParameters
}

@section Pagename{
    <i class="settings icon"></i>@Shared.ChangeParameters
}

@section Scripts{
    <script type="text/javascript">
        $(function () {
            $("#updateDonuts").click(function () {
                $.ajax({
                    type: "POST",
                    dataType: "json",
                    contentType: 'application/json',
                    url: "/Admin/UpdateDonutCatalog",
                    beforeSend: function () {
                        $("#message-icon").removeClass("red").removeClass("green").removeClass("remove").removeClass("checkmark")
                        $("#message").html("");
                        $("#loader").addClass("active");
                    },
                    success: function updateFields(data) {
                        if (data.Success) {
                            $("#message-icon").addClass("green").addClass("checkmark");
                        } else {
                            $("#message-icon").addClass("red").addClass("remove");
                        }
                        $("#message").html(data.Message);
                        $('#dimmerContent').dimmer('show');
                    },
                    complete: function () {
                        $("#loader").removeClass("active");
                    }
                });
            });
        });
    </script>
}

<h3 class="ui header">@Admin.UpdateDonuts</h3>

<div class="ui grid">
    <div class="row">
        <div class="three column wide">
            <input type="button" name="updateDonuts" id="updateDonuts" value="@Admin.Update" class="ui blue button" />
        </div>
    </div>
</div>

<div class="ui clearing divider"></div>

<!-- Message Dimmer -->
<div class="ui page dimmer" id="dimmerContent">
    <div class="content">
        <div class="center">
            <h2 class="ui inverted icon header">
                <i id="message-icon" class="icon circular inverted emphasized"></i>
                <span id="message"></span>
            </h2>
        </div>
    </div>
</div>

<!-- Loader -->
<div id="loader" class="ui page dimmer">
    <div class="ui large text loader">@Shared.Loading</div>
</div>